package fr.ralmn.OgameDroid;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import fr.ralmn.OgameDroid.Object.Batiment;
import fr.ralmn.OgameDroid.Object.Objects;
import fr.ralmn.OgameDroid.Object.Technologie;
import fr.ralmn.OgameDroid.Ressource.Listing;
import fr.ralmn.OgameDroid.list.Adapter.BatimentArrayAdapter;
import fr.ralmn.OgameDroid.list.Adapter.TechoArrayAdapter;

public class RessourcesListActivity extends ListActivity {
	public static BatimentArrayAdapter a;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		a = new BatimentArrayAdapter(this, Listing.getRessources());
		setListAdapter(a);
		
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {

		Batiment b = a.getItem(position);
		Bundle bu = new Bundle();
		bu.putString("technologie", b.getName());
		
		Intent i = new Intent(RessourcesListActivity.this,
		RessourceActivity.class);
		i.putExtras(bu);
		startActivity(i);

	}

}
